<template>
  <div class="titleColumn">
    <div class="titleName">
      <i class="titleIcon"></i>
      <span>{{ name }}</span>
    </div>
    <div class="rightSlot"><slot></slot></div>
  </div>
</template>

<script lang="ts" setup>
  defineOptions({ name: 'TitleColumn' });
  defineProps({
    name: { type: String },
  });
</script>

<style lang="less" rel="stylesheet/less" scoped>
  .titleColumn {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    &::before {
      content: '';
      display: inline-block;
      width: 100%;
      height: 10px;
      background: url('@/assets/images/decorative-lines.png') no-repeat;
      background-size: 100% 100%;
      position: absolute;
      bottom: 0px;
    }
    .titleName {
      display: flex;
      align-items: center;
      width: 170px;
      margin-left: 6px;
      i.titleIcon {
        display: inline-block;
        width: 14px;
        height: 24px;
        background: url('@/assets/images/titleIcon.png') no-repeat;
        background-size: contain;
      }

      span {
        margin-left: 4px;
        color: #333;
        font-size: 16px;
        font-weight: bold;
        font-style: italic;
        transition: all 0.5s;
      }
    }
    .rightSlot {
      max-width: 218px;
      // max-width: calc(100% - 160px);
      // overflow: hidden;
      // overflow-x: auto;
      position: absolute;
      right: 0;
    }
  }
</style>
